<?php
class Admin_Model_I18n
{    
    private static $_instance;
    private static $_table = "i18n";
    
    private function __construct() {
    }
    
    /**
     * @return Admin_Model_I18n
     * */
    public static function factory() {
    	if(self::$_instance == null) {
    		self::$_instance = new self();
    	}
    
    	return self::$_instance;
    }
    
    /**
     * Insert center
     * @param array $data
     * @return 1 on success, 0 on failure
     * */
    public function insert($data) {
        $dao = Admin_Model_DAO_I18n::factory();
        try {
            $result = $dao->insert($data);
            if($result) {//Log
            	$data['id'] = $result;
            	Utils_Global::storeBackendLog('insert', self::$_table, $result, $data);
            }
        } catch (Exception $exc) {
            prBinh($exc);
            Utils_Global::storeLog($exc, __FILE__, __LINE__);
        }
        
        return $result;
    }    
}